package com.ebei.admin.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.ebei.admin.model.dto.OrgRoleDTO;
import com.ebei.admin.model.dto.OrgRoleUserDTO;
import com.ebei.admin.model.entity.SysOrgRole;
import com.ebei.common.util.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 岗位mapper
 */
@Repository
public interface SysOrgRoleMapper extends BaseMapper<SysOrgRole> {

    /**
     * 根据组织id获取岗位信息
     * @param orgId
     * @return
     */
    List<OrgRoleDTO> selectPositionsByOrgId(Integer orgId);

    /**
     * 根据组织id获取成员
     * @param query
     * @param condition
     * @return
     */
    List<OrgRoleUserDTO> selectUsersByPositionId(Query<OrgRoleUserDTO> query, Map<String, Object> condition);

    List<Map<String,Object>> findPositionsByOrgId(String orgId);

}
